projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1513f29
)
core: Don't call unlink() on directory if it already exists
author
Colin Walters
<walters@verbum.org>
Tue, 6 Mar 2012 16:33:42 +0000
(11:33 -0500)
committer
Colin Walters
<walters@verbum.org>
Tue, 6 Mar 2012 16:59:06 +0000
(11:59 -0500)
If we fail to make a directory because it exists, we shouldn't call
unlink() on it.
src/libostree/ostree-core.c
patch
|
blob
|
history
diff --git
a/src/libostree/ostree-core.c
b/src/libostree/ostree-core.c
index 3fe6d220a118d7d49de892180505426fe54dd3db..8a4cb1fd599f133a5ee564082c8d08e79e6937d5 100644
(file)
--- a/
src/libostree/ostree-core.c
+++ b/
src/libostree/ostree-core.c
@@
-839,8
+839,10
@@
ostree_create_file_from_input (GFile *dest_file,
ret = TRUE;
ot_transfer_out_value(out_checksum, &ret_checksum);
out:
- if (!ret)
- (void) unlink (dest_path);
+ if (!ret && !S_ISDIR(mode))
+ {
+ (void) unlink (dest_path);
+ }
ot_clear_checksum (&ret_checksum);
g_clear_object (&out);
return ret;